import axios from './http'
import { getList } from '../util/storage/getlistbycache';

// 创建课程问答
export function createQuestion(data) {
    return axios({
        url: '/api/curr_question/create',
        method: 'post',
        data
    })
}

// 修改课程问答
export function updateQuestion(data) {
    return axios({
        url: '/api/curr_question/update',
        method: 'post',
        data
    })
}

// 获取课程问答列表
export async function getQuestionList(data) {
    return await getList(`/api/curr_question/list${data.currNo ? '?currNo=' + data.currNo : ""}`)
    // return axios({
    //     url: `/api/curr_question/list${data.currNo ? '?currNo=' + data.currNo : ""}`,
    //     method: 'get',
    // })
}

// 删除课程问答
export function deleteQuestion(data) {
    return axios({
        url: '/api/curr_question/delete',
        method: 'post',
        data
    })
}

// 获取课程问答详情
export function getCourseQuestionInfo(data) {
    return axios({
        url: `/api/curr_question/${data.currNo}`,
        method: 'get',
    })
}

